package org.cerberus.platform.internal.impl;

import java.util.Map;

import org.cerberus.platform.internal.domain.IComponentClass;
import org.cerberus.platform.internal.impl.ComponentClass;
import org.cerberus.platform.internal.impl.InMemoryObjectGraphTransaction;

public class ObjectGraphRebuilder {

	private Map<String, IComponentClass> componentClasses;
	private Map<Integer, Object[]> objects;
	
	public void rebuild(InMemoryObjectGraphTransaction transaction) {
		componentClasses.putAll(transaction.getAddClasses());
		objects.putAll(transaction.getAddObjects());
		for (int objectID : transaction.getRemoveObjects()) {
			objects.remove(objectID);
		}
		for (String classID : transaction.getRemoveClasses()) {
			objects.remove(classID);
		}
	}
	
}
